package red.client.registry;

import red.internal.client.registry.DefaultHost;

/**
 * @author Jin Zheng
 * @since 2020-07-12
 */
public interface Host
{
	String SPLIT = ":";

	/**
	 * new instance Host
	 * @param ip
	 * @param port
	 * @return
	 */
	static Host newInstance(String ip, int port)
	{
		return new DefaultHost(ip, port);
	}

	/**
	 * parse string: host:ip
	 * @param addr
	 * @return
	 */
	static Host parse(String addr)
	{
		return new DefaultHost(addr);
	}

	String getIp();

	int getPort();

}
